<?php

namespace App\Http\Controllers\Test;

use App\Http\Controllers\Controller;
use App\Models\Article;


class ComponentController extends Controller
{
    // 组件测试
    // 在美新社中才有测试
    public function initialize()
    {
        parent::initialize();
    }

    // 测试
    public function test()
    {
        //return view('./doctest/index', ['menus' => $authors, 'api_type' => 'doc', 'articles' => $articles]);
        //return view('./frontend/test');
        //$newest = $this->newest();
        $articleDb  = new Article();
        $newest     = $articleDb->getList(['status' => 1], 10, 'id DESC');
        $Components = new Components($this->myUser);

        return $this->dispaly('frontend.test', ['newest' => $newest, 'components' => $Components]);
    }

    // 引入组件
    public function component()
    {
        return $this->dispaly('frontend.component');
    }

}


